import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: 'Period',
    align:"center",
    sorter: true,
    dataIndex: 'version'
   },
   // {
   //  title: 'File',
   //  align:"center",
   //  dataIndex: 'files',
   //  slots: { customRender: 'fileSlot' },
   // },
   // {
   //  title: 'File Name',
   //  align:"center",
   //  dataIndex: 'fileName'
   // },
   {
    title: 'Revision',
    align:"center",
    sorter: true,
    dataIndex: 'revision'
   },
   {
    title: 'Comment',
    align:"center",
    dataIndex: 'comment'
   },
   {
    title: 'Update User',
    align:"center",
    dataIndex: 'updateBy'
   },
   {
    title: 'Update Time',
    align:"center",
    sorter: true,
    dataIndex: 'updateTime'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: 'Period',
    field: 'version',
    component: 'JPopup',
    componentProps: ({ formActionType }) => {
        const {setFieldsValue} = formActionType;
        return{
            setFieldsValue:setFieldsValue,
            code:"mp_currentversion",
            fieldConfig: [
                { source: 'version', target: 'version' },
            ],
            multi:true
        }
    },

  },
  {
    label: 'File',
    field: 'files',
    component: 'JUpload',
    componentProps:{
     },
  },
  {
    label: 'File Name',
    field: 'fileName',
    component: 'Input',
  },
  {
    label: 'Revision',
    field: 'revision',
    component: 'InputNumber',
  },
  {
    label: 'Comment',
    field: 'comment',
    component: 'Input',
  },
  {
    label: '删除标记',
    field: 'delFlag',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];
